package com.yc.book.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

//单例模式
public class ReadProperties extends Properties{
	private static final long serialVersionUID = 1L;
	private static ReadProperties instance = new ReadProperties();//饿汉式
	
	private ReadProperties() {
		try(InputStream is = ReadProperties.class.getClassLoader().getResourceAsStream("db.properties")){
			this.load(is);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static ReadProperties getIntance() {
		return instance;
	}
}
